package com.ndp.fb.enums.targetingspec;

import lombok.Getter;

/**
 * Created by Sisi on 14-12-24.
 */
@Getter
public enum InterestedInType {
    MAN(1, "Man"),

    WOMEN(2, "Women");

    private int code;

    private String interestedIn;

     InterestedInType(int code, String interestedIn) {
        this.code = code;
        this.interestedIn = interestedIn;
    }

    /**
     * 根据code获取InterestedIn
     *
     * @param code code
     * @return InterestedIn
     */
    public static InterestedInType getInterestedIn(int code) {
        for (InterestedInType c : InterestedInType.values()) {
            if (c.code == code) {
                return c;
            }
        }
        return null;
    }
}
